<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>手写Promise</title>
    <script src="./promise.js"></script>
</head>

<body>
    <script>
        let p = new Promise((resolve, reject) => {
            setTimeout(() => {
                resolve('OK')
                // reject('error')
                router
            }, 1000)


            // throw "error"
        })


        p.then(value => {
            console.log(value)
        }, reason => {
            console.warn(reason)
        })

        console.log(p)
    </script>
</body>

</html>